package com.panasonic.web.service.impl;

import com.panasonic.web.mapper.CmsAttachmentMapper;
import com.panasonic.web.mapper.CmsCategoryMapper;
import com.panasonic.web.mapper.CmsUserMapper;
import com.panasonic.web.service.IHomeService;
import com.panasonic.web.vo.HomeVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @className: HomeServiceImpl
 * @description: TODO 类描述
 * @author: laiweifeng
 * @date: 2021/11/22
 **/
@Service
public class HomeServiceImpl implements IHomeService {

    @Autowired
    private CmsUserMapper cmsUserMapper;

    @Autowired
    private CmsCategoryMapper cmsCategoryMapper;

    @Autowired
    private CmsAttachmentMapper cmsAttachmentMapper;

    @Override
    public HomeVo getData() {
        HomeVo homeVo = new HomeVo();
        homeVo.setManagerCount(cmsUserMapper.selectManagerCount());
        homeVo.setRepairCount(cmsUserMapper.selectRepairCount());
        homeVo.setDepartmentCount(cmsCategoryMapper.selectDepartmentCount());
        homeVo.setAttachmentCount(cmsAttachmentMapper.selectAttachmentCount());

        return homeVo;
    }
}
